package com.harmony.controller;

import com.harmony.dao.EmployeeRepository;
import com.harmony.entity.Employee;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 员工 Controller
 *
 * @author : harmony
 * @date : 2025-01-30 22-10-10
 **/
@RestController
@RequestMapping("/employee")
public class EmployeeController {

    @Resource
    private EmployeeRepository employeeRepository;

    @PostMapping("/save")
    public void save() {
        Employee employee = new Employee();
        employee.setId(1L);
        employee.setName("张三");
        employee.setAge(18);
        employee.setSex("男");
        employee.setAddress("北京");
        employeeRepository.save(employee);
    }





}
